<template>
	<view>
		<view class="wallet-list" v-if="marthlist.length>0" v-for="(item,index) in marthlist" :key="item.id">
			<view class="top">
				<view class="title">{{item.name}}</view>
				<view class="num" v-if="item.money">{{item.money}}</view>
			</view>
			<view class="bottom">
				<view class="mintitle">{{item.oldmoney}}</view>
				<view class="data">{{item.createtime}}</view>
			</view>
		</view>
		<noneDate v-if="marthlist.length==0">
		</noneDate>
	</view>
</template>

<script>
	import noneDate from '@/components/noneDate/noneDate.vue'
	export default {
		data() {
			return {
				marthlist: [],
				id: '',
				page:1
			};
		},
		components:{
			noneDate
		},
		onLoad(options) {
			// uni.setNavigationBarTitle({
			// 	title:options.name
			// })
			// this.id = options.id
			this.init()
		},
		onReachBottom(){
			this.getList()
		},
		methods: {
			// 初始化
			init() {
				this.getList()
			},
			getList() {
				this.$fun.ajax.post('luck/myluck',{page:this.page,limit:10}).then(res=>{
					if(res.code==1 && res.data.length>0){
						this.marthlist.push(...res.data)
						this.page++
					}else{
						if(this.page!=1){
							this.$fun.msg('没有更多数据了...')
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
page {
  background: #f7f7f9;
}
.wallet-list {
  width: 700upx;
  margin: 25upx auto;
  background: #fff;
  border-radius: 10upx;
  padding: 40upx 20upx 40upx 23upx;
  box-sizing: border-box;
}
.wallet-list .top {
  display: flex;
  justify-content: space-between;
}
.wallet-list .top .title {
  color: #323232;
  font-size: 30upx;
}
.wallet-list .top .num {
  color: #db1121;
  font-size: 36upx;
}
.wallet-list .bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 20upx;
  font-size: 24upx;
}
.wallet-list .bottom .mintitle {
  color: #808080;
}
.wallet-list .bottom .data {
  color: #808080;
}

</style>
